package com.keepmoving.service.impl;

import com.keepmoving.dao.ReplyDao;
import com.keepmoving.po.Reply;
import com.keepmoving.service.ReplyService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 魏范彬
 * 回复业务逻辑实现类
 */
@Service
public class ReplyServiceImpl implements ReplyService {
    //数据访问注入
    @Resource
    ReplyDao replyDao;

    @Override
    public List<Reply> findAll() {
        return replyDao.findAll();
    }

    @Override
    public List<Reply> findById(int id) {
        return replyDao.findById(id);
    }

    @Override
    public Reply findBypId(int pId) {
        return replyDao.findBypId(pId);
    }

    @Override
    public boolean insert(Reply reply) {
        return replyDao.insert(reply)>0?true:false;
    }

    @Override
    public boolean delete(int pid) {
        return replyDao.delete(pid)>0?true:false;
    }

    @Override
    public boolean update(Reply reply) {
        return replyDao.update(reply)>0?true:false;
    }
}
